package ru.beta2.testyard.engine.points;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import ru.beta2.testyard.engine.HotspotEvent;

/**
 * User: Inc
 * Date: 18.06.2008
 * Time: 21:01:33
 */
public class PlayerEvent extends HotspotEvent
{

    public static final String LOGGED_IN = "loggedIn";
    public static final String DISCONNECTED = "disconnected";

    private final int player;

    public PlayerEvent(String type, int player)
    {
        super(type);
        this.player = player;
    }

    public int getPlayer()
    {
        return player;
    }

    public int hashCode()
    {
        return HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj)
    {
        return EqualsBuilder.reflectionEquals(this, obj);
    }

    public String toString()
    {
        return ReflectionToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}
